package problems.solved;

import java.math.BigInteger;

public class Problem63 {
	public static void main(String[] args) {
		int count = 0;
		for (int base = 1; base < 10; base++) {
			BigInteger base1 = BigInteger.valueOf(base);
			for (int exp = 1; exp < 22; exp++) {
				String value = base1.pow(exp).toString();
				int length = value.length();
				if (length == exp) {
					count++;
				}
				else if (exp > length) break;
			}
		}
		System.out.printf("Found %d results%n", count); //49
	}
}
